<template>
	<view class="signature-list">
		<titleName :name="name" :backShow="true"></titleName>
		<view class="container">
			<NoData v-if="dataList.length==0" />
			<view class="item" v-for="item in dataList" :key="item.id">
				<view class="title">落实重污染天气应急管控承诺书</view>
				<view class="content">
					<view class="msg">
						<view class="enterprise">
							<view class="name">企业名称：</view>
							<view class="val">{{item.enterprisename}}</view>
						</view>
						<view class="person">
							<view class="name">负责人：</view>
							<view class="val">{{item.personname}}</view>
						</view>
						
						<view class="time">
							<view class="name">签名时间：</view>
							<view class="val">{{item.promisetime}}</view>
						</view>
					</view>
					<view class="btn" @click="searchSignature(item)">
						<button>查看</button>
					</view>
				</view>
			</view>

		</view>

	</view>

</template>

<script setup>
	import NoData from '../../components/noDataShow.vue'
	import titleName from '../../components/titleName.vue'
	import http from '../../request/index.js'
	import uploadFile from '../../request/uploadFile'
	import {
		resourceUrl
	} from '../../request/config'
	import {
		onLoad,
		onShow
	} from '@dcloudio/uni-app'
	import {
		ref
	} from 'vue'
	let usertype = ref('')

	let enterpriseid = ref('')

	let name = "承诺书"
	let dataList = ref([])

	let searchSignature = (item) => {
		uni.navigateTo({
			url: `/homePageOther/managesearchundertaking/index?msg=${JSON.stringify(item)}`
		})
	}
	onLoad((e) => {

		enterpriseid.value = e.enterpriseid
		http({
			url: "/greenAdmPromise/datalist",
			data: {
				enterpriseid: e.enterpriseid
			}
		}).then((res) => {
			if (res.code == 0) {
				dataList.value = res.data.list
			}

		})


	})
</script>

<style lang="scss" scoped>
	.signature-list {
		width: 100vw;
		height: 100vh;

		.container {
			height: calc(100vh - 160upx);
			overflow: scroll;
			padding: 34upx 27upx 34upx 27upx;
			background: #F3F5F7;

			.item:first-child {
				margin-top: 0 !important;
			}

			.item {
				width: 100%;
				height: 305rpx;
				background: #FFFFFF;
				padding: 0 40upx 0 22upx;
				border-radius: 14rpx;
				margin-top: 28upx;

				.title {
					height: 103upx;
					width: 100%;
					line-height: 103upx;
					border-bottom: 2upx solid #ccc;
					padding-left: 6upx;
				}

				.content {
					display: flex;
					justify-content: space-between;
					align-items: center;
					height: calc(305upx - 103upx);

					.msg {
						height: calc(305upx - 103upx);
						display: flex;
						padding: 35upx 0 40upx 0;
						flex-direction: column;
						justify-content: space-between;

						.enterprise,
						.person,
						.time {
							display: flex;
							align-items: center;

							.name {
								padding-left: 6upx;
								font-family: Source Han Sans CN;
								font-weight: 400;
								font-size: 25rpx;
								color: #666666;

							}

							.val {

								font-family: Source Han Sans CN;
								font-weight: 400;
								font-size: 25rpx;
								color: #333333;

							}
						}

						.person {
							.name {}

							.val {}
						}

						.time {
							.name {}

							.val {}
						}
					}

					.btn {
						button {
							width: 172rpx;
							height: 65rpx;
							background: #0874FA;
							border-radius: 33rpx;
							line-height: 65upx;
							font-family: Source Han Sans CN;
							font-weight: 400;
							font-size: 28rpx;
							color: #FFFFFF;

						}
					}
				}
			}



		}


	}
</style>